//
//  BaseTabbarVC.swift
//  ListenFM
//
//  Created by 胡定锋Mac on 2017/8/4.
//  Copyright © 2017年 胡定锋. All rights reserved.
//

import UIKit
import RAMAnimatedTabBarController

class BaseTabbarVC: UITabBarController {

    @IBOutlet weak var tabbar: UITabBar!
    
    override func viewDidLoad() {
        super.viewDidLoad()
//        addChildViewControllers()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        
        
    }

    private func addChildViewControllers() {
        addChildViewController(childController: HomePageVC(), title: "首页", imageName: "tabBar_0", selectedImage: "tabBar_0_selected")
        addChildViewController(childController: DiscoverVC(), title: "发现", imageName: "tabBar_1", selectedImage: "tabBar_1_selected")
        addChildViewController(childController: CommunityVC(), title: "社区", imageName: "tabBar_2", selectedImage: "tabBar_2_selected")
        addChildViewController(childController: PersonalVC(), title: "我的", imageName: "tabBar_3", selectedImage: "tabBar_3_selected")
    }
    
    private func addChildViewController(childController: UIViewController, title: String, imageName: String, selectedImage: String) {
        childController.tabBarItem.image = UIImage(named: imageName)
        childController.tabBarItem.selectedImage = UIImage(named: selectedImage)
        childController.title = title
        let navC = BaseNavVC(rootViewController: childController)
        addChildViewController(navC)
    }
    
}
